﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.HandleErrorInfo>" %>

<asp:Content ID="errorTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Error
</asp:Content>

<asp:Content ID="errorContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Sorry, an error occurred while processing your request.
    </h2>
    
        <% if (ViewContext.HttpContext.Request.IsLocal) { %>
        <h3>
            Action details:
        </h3>
        <div>
        <ul>
        <li><b>Controller name</b>: <%=Model.ControllerName %></li>
        <li><b>Action name</b>: <%=Model.ActionName %></li>
        </ul>
        </div>
        <h3>
            Exception details:
        </h3>
        <div style="overflow: auto;">
            <%
                Stack<Exception> exceptions = new Stack<Exception>();
                for (Exception ex = Model.Exception;
                    ex != null;
                    ex = ex.InnerException) {
                    exceptions.Push(ex);
                }
                foreach (Exception ex in exceptions) {
                    %>
                        <div>
                            <b><%= Html.Encode(ex.GetType().FullName)%></b>:
                                <%= Html.Encode(ex.Message)%>
                        </div>
                        <div>
                            <pre style="font-size: medium;"><%= Html.Encode(ex.StackTrace)%></pre>
                        </div>
                    <%
                }  
            %>
        </div>
    <% } %>
    
</asp:Content>
